//C10:ep10_24.c: return pointer of function.
// scores of 4 courses,output the scores.
#include <stdio.h>

int main(void)
{
    float score[][4] = {
        {60,70,80,90},
        {56,89,67,88},
        {34,78,90,66}
    };

    float * search(float(*pointer)[4], int n);
    float *p;
    int i, m;

    printf("enter the number of student:\n");
    scanf("%d", &m);

    printf("The scores of No.%d are:\n", m);
    p = search(score, m);

    for(i = 0; i < 4; i++)
    {
        printf("%5.2f\t", *(p + i));
    }
    printf("\n");
    return 0;
}

float *search(float(*pointer)[4], int n)
{
    float *pt;
    pt = *(pointer + n);
    return pt;
}